/* 基础主题与排版 */
:root {
  --bg: #0b0c10;
  --card: #121318;
  --text: #e6e8eb;
  --muted: #aeb4bc;
  --primary: #3a86ff;
  --green: #2ec4b6;
  --orange: #ff7f50;
  --purple: #a259ff;
  --red: #ff4d4f;
  --border: #1f2228;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f6f7f9; --card: #ffffff; --text: #1f2328; --muted: #6b7280; --border: #e5e7eb; }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.6 system-ui, -apple-system, Segoe UI, Roboto, PingFang SC, "Microsoft YaHei", sans-serif; }

/* 顶部与容器 */
.site-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); backdrop-filter: saturate(120%) blur(8px); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand .logo { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: linear-gradient(135deg, #9be7ff, #e3ffe7); color: #111; }
.brand h1 { margin: 0; font-size: 18px; }
.brand p { margin: 0; color: var(--muted); font-size: 12px; }
.actions { display: flex; gap: 8px; }

.container { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.card { grid-column: span 6; background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.card-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--border); }
.card-head h2 { margin: 0 0 6px; font-size: 18px; }
.card-head p { margin: 0; color: var(--muted); font-size: 13px; }
.card-body { padding: 16px; }
@media (max-width: 900px) { .card { grid-column: span 12; } }

/* 渐变头 */
.gradient-green { background: linear-gradient(135deg, rgba(46,196,182,.25), transparent); }
.gradient-blue { background: linear-gradient(135deg, rgba(58,134,255,.25), transparent); }
.gradient-orange { background: linear-gradient(135deg, rgba(255,127,80,.25), transparent); }
.gradient-purple { background: linear-gradient(135deg, rgba(162,89,255,.25), transparent); }

/* 按钮与输入 */
button, .ghost-btn { appearance: none; border: 1px solid var(--border); background: var(--card); color: var(--text); border-radius: 10px; padding: 8px 12px; cursor: pointer; transition: .2s ease; }
button:hover, .ghost-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 12px rgba(0,0,0,.15); }
button.primary { background: var(--primary); border-color: transparent; color: #fff; }
button.danger { background: var(--red); border-color: transparent; color: #fff; }
button.ghost { background: transparent; }
input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--text); }
label { display: grid; gap: 6px; margin-bottom: 10px; }
.form .row { display: flex; gap: 10px; }
.form .two { width: 100%; }

/* 指标条 */
.metrics { display: grid; grid-template-columns: 1fr; gap: 12px; }
.metric { display: grid; grid-template-columns: 80px 1fr 1fr; align-items: center; gap: 8px; }
.metric .label { color: var(--muted); }
.metric .value { font-weight: 600; }
.bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; border: 1px solid var(--border); }
.bar > div { height: 100%; width: 0%; background: linear-gradient(90deg, #9be15d, #00e3ae); transition: width .5s ease; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; color: var(--muted); }
.chip.good { color: #00e3ae; border-color: #00e3ae44; }
.chip.warn { color: #f59e0b; border-color: #f59e0b44; }
.chip.bad { color: #ef4444; border-color: #ef444444; }

/* 摘要与提醒 */
.summary { margin-top: 12px; padding: 10px; border: 1px dashed var(--border); border-radius: 12px; color: var(--muted); }
.remind { margin-top: 8px; display: grid; gap: 6px; }
.remind .pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(58,134,255,.12); color: #cfe0ff; border: 1px solid rgba(58,134,255,.25); }

/* 跌倒状态 */
.status { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #00e3ae; box-shadow: 0 0 0 6px rgba(0,227,174,.15); transition: .3s ease; }
.dot.warn { background: #f59e0b; box-shadow: 0 0 0 6px rgba(245,158,11,.15); }
.dot.bad { background: #ef4444; box-shadow: 0 0 0 6px rgba(239,68,68,.15); }

/* 聊天 */
.chat { display: grid; gap: 8px; max-height: 220px; overflow: auto; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: rgba(162,89,255,.08); }
.bubble { max-width: 80%; padding: 8px 10px; border-radius: 12px; }
.bubble.bot { background: rgba(255,255,255,.08); border: 1px solid var(--border); }
.bubble.me { background: var(--primary); color: #fff; justify-self: end; }
#therapy-card .row { align-items: center; }
#chat-mic { width: 40px; aspect-ratio: 1/1; display: inline-grid; place-items: center; font-size: 18px; }
#chat-mic.recording { background: var(--red); color: #fff; border-color: transparent; box-shadow: 0 0 0 6px rgba(239,68,68,.15); }

/* 页脚 */
.site-footer { text-align: center; padding: 24px 16px; color: var(--muted); border-top: 1px solid var(--border); margin-top: 24px; }